# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: jhkim

from coin.strategy.mm.base.feed_arb_base import (FeedArbSubscriberHandler, FeedArbSubsystem)
from coin.strategy.mm.subscription import SubscriptionRequest

from coin.exchange.bitflyer_v1.ws.subscriber import BitflyerMultiSubscriber
from coin.strategy.mm.feed_arb import (BitflyerFeedArbFlowBookBuilder)


class BitflyerFeedArbSubscriberHandler(FeedArbSubscriberHandler):
  SubscriberType = BitflyerMultiSubscriber


class BitflyerFeedArbSubsystem(FeedArbSubsystem):
  FlowBookBuilder = BitflyerFeedArbFlowBookBuilder
  FeedSubscriber = BitflyerFeedArbSubscriberHandler
  FeedSubReq = SubscriptionRequest('Futures', 'Bitflyer', 'v1')

  def set_price_limit_error_callback(self, callback):
    self._price_limit_error_callback = callback
